package com.leyou.search.web;

import com.leyou.search.service.StaticService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("staticify")
public class StaticServiceController {

    private final StaticService staticService;

    public StaticServiceController(StaticService staticService) {
        this.staticService = staticService;
    }

    /**
     * 对外暴露的静态服务接口
     * @param
     * @return
     */
    @GetMapping("index")
    public ResponseEntity<String> loadItemData() {
        Boolean success = staticService.staticIfyIndex();
        return ResponseEntity.ok(success?"首页静态化成功":"首页静态化失败");
    }


}